package com.dldata.devtools30.service.sysform;

import com.dldata.devtools30.entity.DevtFormDesignEntity;
import com.dldata.devtools30.repository.sysform.DevtFormDesignEntityDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by zhw
 * on 2020-08-17.
 */
@Service
public class DevtFormDesignEntityService {

    @Autowired
    DevtFormDesignEntityDao formDesignDao;

    public List<DevtFormDesignEntity> getFormDesignDataByTempid(String tempid){
        return formDesignDao.getFormDesignDataByTempid(tempid);
    }

    public void deleteDataByTempid(String tempid){
        List<DevtFormDesignEntity> entityList = formDesignDao.getFormDesignDataByTempid(tempid);
        entityList.stream().forEach(p->{
            formDesignDao.deleteById(p.getId());
        });
    }
}
